package com.zzzy.doc.vo.document.my;

import com.zzzy.common.enums.YesOrNoEnum;
import com.zzzy.doc.common.enums.SecretLevelEnum;
import com.zzzy.doc.common.enums.UrgencyEnum;
import com.zzzy.framework.common.annotation.RangeValuesCheck;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.NotBlank;
import java.time.LocalDate;

@Data
public class DocBasicOperateReq {

    @Schema(description = "发文标题")
    @Length(max = 100, message = "发文标题不能超过100个字符")
    @NotBlank(message = "发文标题不能为空")
    private String subject;

    @Schema(description = "发文字号")
    @Length(max = 50, message = "文件编号不能超过50个字符")
    private String docNo;

    @Schema(description = "紧急程度（普通、紧急、特级）")
    @RangeValuesCheck(enumValueRange = UrgencyEnum.class, message = "紧急程度填写错误")
    private Integer urgency;

    @Schema(description = "密级（公开、限阅、秘密、机密、绝密）")
    @RangeValuesCheck(enumValueRange = SecretLevelEnum.class, message = "密级填写错误")
    private String secretLevel;

    @Schema(description = "发文单位")
    @Length(max = 255, message = "发文单位不能超过255个字符")
    private String sendUnit;

    @Schema(description = "发文单位意见")
    @Length(max = 2048, message = "发文单位不能超过2048个字符")
    private String sendUnitAdvice;

    @Schema(description = "主送单位ID字符串,以英文逗号分隔")
    private String mainSendUnitIds;

    @Schema(description = "主送单位ID字符串,以英文逗号分隔")
    private String copySendUnitIds;

    @Schema(description = "限办日期")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private LocalDate endDate;

    @Schema(description = "印发日期")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private LocalDate printDate;

    @Schema(description = "印发机关")
    @Length(max = 255, message = "印发机关不能超过255个字符")
    private String printUnit;

    @Schema(description = "印发份数")
    private Integer printCount;

    @Schema(description = "是否允许拷贝（是、否）")
    @RangeValuesCheck(enumValueRange = YesOrNoEnum.class, message = "是否允许拷贝填写错误")
    private String isAllowCopy;

    @Schema(description = "是否添加水印（是、否）")
    @RangeValuesCheck(enumValueRange = YesOrNoEnum.class, message = "是否添加水印填写错误")
    private String isWaterMark;

    @Schema(description = "公文摘要")
    @Length(max = 1000, message = "印发机关不能超过1000个字符")
    private String docPrecis;

    @Schema(description = "说明")
    @Length(max = 255, message = "说明不能超过255个字符")
    private String memo;
}
